package org.example.user.statistic.service;

import org.example.commons.entity.SysHealthRecord;
import org.example.commons.entity.SysHealthStatus;
import org.example.commons.entity.SysUser;
import org.example.commons.service.IBaseService;
import org.example.user.statistic.dto.SysHealthRecordDTO;
import org.example.user.statistic.form.HealthRecordSearchForm;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Date;
import java.util.List;

/**
 * 扫描记录 服务层接口
 * @author bothin
 */
public interface ISysHealthRecordService extends IBaseService<SysHealthRecordDTO> {
    List<SysHealthRecordDTO> findByRecordIdIn(Long[] ids);

    /**
     * 根据扫描管理人员id查询健康记录
     * @param adminId 扫描管理人员id
     * @param pageable 分页
     * @return
     */
    Page<SysHealthRecordDTO> findByAdminId(Long adminId, Pageable pageable);

    /**
     * 根据住户id查询健康记录
     * @param userId 住户id
     * @param pageable 分页
     * @return
     */
    Page<SysHealthRecordDTO> findByUserId(Long userId, Pageable pageable);

    /**
     * 条件查询
     * @param form
     * @param pageable
     * @return
     */
    Page<SysHealthRecordDTO> searchList(HealthRecordSearchForm form, Pageable pageable);

    List<SysHealthRecord> queryLastRecordBydays(Integer days);
    List<SysHealthRecord> queryTimeRecordBydays(Integer day1,Integer day2);
    List<Float> queryLastTimesUser(Long userId, Integer times);
    List<Date> findLastTimesUserRecord(Long userId, Integer times);
    Float  findTimeAvgTemperature(Integer day1, Integer day2);
    Long findTimeSum(Integer day1, Integer day2);
}
